# $Id: PKGBUILD 108456 2014-03-27 14:47:54Z fyan $
# Maintainer: jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>

pkgbase=python-mock
pkgname=(python2-mock python3-mock)
pkgver=1.0.1
pkgrel=2
pkgdesc='Mocking and Patching Library for Testing'
url='http://www.voidspace.org.uk/python/mock/'
makedepends=('python2' 'python3')
license=('BSD')
arch=('any')
source=("https://pypi.python.org/packages/source/m/mock/mock-$pkgver.tar.gz")
sha256sums=('b839dd2d9c117c701430c149956918a423a9863b48b09c90e30a6013e7d2f44f')

build() {
  cd "$srcdir"
  cp -rf "mock-$pkgver" "mock2-$pkgver"

  cd "$srcdir/mock-$pkgver"
  python3 setup.py build

  cd "$srcdir/mock2-$pkgver"
  python2 setup.py build
}

package_python3-mock() {
depends=('python3')
  cd "$srcdir/mock-$pkgver"
  python3 setup.py install --optimize=1 --root="$pkgdir"
  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

package_python2-mock() {
depends=('python2')
  cd "$srcdir/mock2-$pkgver"
  python2 setup.py install --optimize=1 --root="$pkgdir"
  install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
